home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / ddragon3.c < prev    next >
C/C++ Source or Header  |  2000-04-23  |  32KB  |  872 lines

  1. /******************************************************************
  2.  
  3.     Double Dragon 3                        Technos Japan Corp 1990
  4.     The Combatribes                        Technos Japan Corp 1990
  5.  
  6.  
  7.     Notes:
  8.  
  9.     Both games have original and bootleg versions supported.
  10.     Double Dragon 3 bootleg has some misplaced graphics, but I
  11.     think this is how the real thing would look.
  12.     Double Dragon 3 original cut scenes seem to fade a bit fast?
  13.     Combatribes has sprite lag but it seems to be caused by poor
  14.     programming and I think the original does the same.
  15.  
  16. ******************************************************************/
  17.  
  18. #include "driver.h"
  19. #include "cpu/z80/z80.h"
  20. #include "cpu/m68000/m68000.h"
  21. #include "vidhrdw/generic.h"
  22.  
  23. void ddragon3_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  24. void ctribe_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  25. WRITE_HANDLER( ddragon3_scroll_w );
  26.  
  27. extern int ddragon3_vh_start(void);
  28.  
  29. extern unsigned char *ddragon3_bg_videoram;
  30. WRITE_HANDLER( ddragon3_bg_videoram_w );
  31. READ_HANDLER( ddragon3_bg_videoram_r );
  32.  
  33. extern unsigned char *ddragon3_fg_videoram;
  34. WRITE_HANDLER( ddragon3_fg_videoram_w );
  35. READ_HANDLER( ddragon3_fg_videoram_r );
  36.  
  37. /***************************************************************************/
  38.  
  39. static WRITE_HANDLER( oki_bankswitch_w )
  40. {
  41.     OKIM6295_set_bank_base(0, ALL_VOICES, (data & 1) * 0x40000);
  42. }
  43.  
  44. static READ_HANDLER( ddrago3b_io_r )
  45. {
  46.     switch (offset) {
  47.         case 0x0: return readinputport(0) + 256*((readinputport(3)&0x0f)|((readinputport(4)&0xc0)<<2));
  48.         case 0x2: return readinputport(1) + 256*(readinputport(4)&0x3f);
  49.         case 0x4: return readinputport(2) + 256*(readinputport(5)&0x3f);
  50.         case 0x6: return (readinputport(5)&0xc0)<<2;
  51.     }
  52.     return 0xffff;
  53. }
  54.  
  55. static READ_HANDLER( ctribe_io_r ){
  56.     switch (offset) {
  57.         case 0x0: return readinputport(0) + 256*((readinputport(3)&0x0f)|((readinputport(4)&0xc0)<<2));
  58.         case 0x2: return readinputport(1) + 256*(readinputport(4)&0x3f);
  59.         case 0x4: return readinputport(2) + 256*(readinputport(5)&0x3f);
  60.         case 0x6: return 256*(readinputport(5)&0xc0);
  61.     }
  62.     return 0xffff;
  63. }
  64.  
  65. static READ_HANDLER( ddragon3_io_r )
  66. {
  67.     switch (offset) {
  68.         case 0x0: return readinputport(0);
  69.         case 0x2: return readinputport(1);
  70.         case 0x4: return readinputport(2);
  71.         case 0x6: return readinputport(3);
  72.  
  73.         default:
  74.         logerror("INPUT 1800[%02x] \n", offset);
  75.         return 0xffff;
  76.     }
  77. }
  78.  
  79. extern UINT16 ddragon3_vreg;
  80.  
  81. static int ddragon3_cpu_interrupt(void) { /* 6:0x177e - 5:0x176a */
  82.     if( cpu_getiloops() == 0 ){
  83.         return MC68000_IRQ_6;  /* VBlank */
  84.     }
  85.     else {
  86.         return MC68000_IRQ_5; /* Input Ports */
  87.     }
  88.     return MC68000_INT_NONE;
  89. }
  90.  
  91. static UINT16 reg[8];
  92.  
  93. static WRITE_HANDLER( ddragon3_io_w ){
  94.     reg[offset/2] = COMBINE_WORD(reg[offset],data);
  95.  
  96.     switch (offset) {
  97.         case 0x0:
  98.         ddragon3_vreg = reg[0];
  99.         break;
  100.  
  101.         case 0x2: /* soundlatch_w */
  102.         soundlatch_w(1,reg[1]&0xff);
  103.         cpu_cause_interrupt( 1, Z80_NMI_INT );
  104.         break;
  105.  
  106.         case 0x4:
  107.         /*    this gets written to on startup and at the end of IRQ6
  108.         **    possibly trigger IRQ on sound CPU
  109.         */
  110.         break;
  111.  
  112.         case 0x6:
  113.         /*    this gets written to on startup,
  114.         **    and at the end of IRQ5 (input port read) */
  115.         break;
  116.  
  117.         case 0x8:
  118.         /* this gets written to at the end of IRQ6 only */
  119.         break;
  120.  
  121.         default:
  122.         logerror("OUTPUT 1400[%02x] %08x, pc=%06x \n", offset,(unsigned)data, cpu_get_pc() );
  123.         break;
  124.     }
  125. }
  126.  
  127. /**************************************************************************/
  128.  
  129. static struct MemoryReadAddress readmem[] =
  130. {
  131.     { 0x000000, 0x07ffff, MRA_ROM   },
  132.     { 0x080000, 0x080fff, ddragon3_fg_videoram_r }, /* Foreground (32x32 Tiles - 4 by per tile) */
  133.     { 0x082000, 0x0827ff, ddragon3_bg_videoram_r }, /* Background (32x32 Tiles - 2 by per tile) */
  134.     { 0x100000, 0x100007, ddragon3_io_r },
  135.     { 0x140000, 0x1405ff, paletteram_word_r },
  136.     { 0x180000, 0x180fff, MRA_BANK1 },
  137.     { 0x1c0000, 0x1c3fff, MRA_BANK2 }, /* working RAM */
  138.     { -1 }
  139. };
  140.  
  141. static struct MemoryWriteAddress writemem[] =
  142. {
  143.     { 0x000000, 0x07ffff, MWA_ROM },
  144.     { 0x080000, 0x080fff, ddragon3_fg_videoram_w, &ddragon3_fg_videoram },
  145.     { 0x082000, 0x0827ff, ddragon3_bg_videoram_w, &ddragon3_bg_videoram },
  146.     { 0x0c0000, 0x0c000f, ddragon3_scroll_w },
  147.     { 0x100000, 0x10000f, ddragon3_io_w },
  148.     { 0x140000, 0x1405ff, paletteram_xBBBBBGGGGGRRRRR_word_w, &paletteram},
  149.     { 0x180000, 0x180fff, MWA_BANK1, &spriteram }, /* Sprites (16 bytes per sprite) */
  150.     { 0x1c0000, 0x1c3fff, MWA_BANK2 },
  151.     { -1 }
  152. };
  153.  
  154. static struct MemoryReadAddress dd3b_readmem[] = {
  155.     { 0x000000, 0x07ffff, MRA_ROM   },
  156.     { 0x080000, 0x080fff, ddragon3_fg_videoram_r }, /* Foreground (32x32 Tiles - 4 by per tile) */
  157.     { 0x081000, 0x081fff, MRA_BANK1 },
  158.     { 0x082000, 0x0827ff, ddragon3_bg_videoram_r }, /* Background (32x32 Tiles - 2 by per tile) */
  159.     { 0x100000, 0x1005ff, paletteram_word_r },
  160.     { 0x180000, 0x180007, ddrago3b_io_r },
  161.     { 0x1c0000, 0x1c3fff, MRA_BANK2 }, /* working RAM */
  162.     { -1 }
  163. };
  164.  
  165. static struct MemoryWriteAddress dd3b_writemem[] = {
  166.     { 0x000000, 0x07ffff, MWA_ROM },
  167.     { 0x080000, 0x080fff, ddragon3_fg_videoram_w, &ddragon3_fg_videoram },
  168.     { 0x081000, 0x081fff, MWA_BANK1, &spriteram }, /* Sprites (16 bytes per sprite) */
  169.     { 0x082000, 0x0827ff, ddragon3_bg_videoram_w, &ddragon3_bg_videoram },
  170.     { 0x0c0000, 0x0c000f, ddragon3_scroll_w },
  171.     { 0x100000, 0x1005ff, paletteram_xBBBBBGGGGGRRRRR_word_w, &paletteram},
  172.     { 0x140000, 0x14000f, ddragon3_io_w },
  173.     { 0x1c0000, 0x1c3fff, MWA_BANK2 },
  174.     { -1 }
  175. };
  176.  
  177. static struct MemoryReadAddress ctribe_readmem[] = {
  178.     { 0x000000, 0x07ffff, MRA_ROM },
  179.     { 0x080000, 0x080fff, ddragon3_fg_videoram_r }, /* Foreground (32x32 Tiles - 4 by per tile) */
  180.     { 0x081000, 0x081fff, MRA_BANK1 },
  181.     { 0x082000, 0x0827ff, ddragon3_bg_videoram_r }, /* Background (32x32 Tiles - 2 by per tile) */
  182.     { 0x100000, 0x1005ff, paletteram_word_r },
  183.     { 0x180000, 0x180007, ctribe_io_r },
  184.     { 0x1c0000, 0x1c3fff, MRA_BANK2 }, /* working RAM */
  185.     { -1 }
  186. };
  187.  
  188. static struct MemoryWriteAddress ctribe_writemem[] = {
  189.     { 0x000000, 0x07ffff, MWA_ROM },
  190.     { 0x080000, 0x080fff, ddragon3_fg_videoram_w, &ddragon3_fg_videoram },
  191.     { 0x081000, 0x081fff, MWA_BANK1, &spriteram }, /* Sprites (16 bytes per sprite) */
  192.     { 0x082000, 0x0827ff, ddragon3_bg_videoram_w, &ddragon3_bg_videoram },
  193.     { 0x0c0000, 0x0c000f, ddragon3_scroll_w },
  194.     { 0x100000, 0x1005ff, paletteram_xxxxBBBBGGGGRRRR_word_w, &paletteram},
  195.     { 0x140000, 0x14000f, ddragon3_io_w },
  196.     { 0x1c0000, 0x1c3fff, MWA_BANK2 },
  197.     { -1 }
  198. };
  199.  
  200. /**************************************************************************/
  201.  
  202. static struct MemoryReadAddress readmem_sound[] = {
  203.     { 0x0000, 0xbfff, MRA_ROM },
  204.     { 0xc000, 0xc7ff, MRA_RAM },
  205.     { 0xc801, 0xc801, YM2151_status_port_0_r },
  206.     { 0xd800, 0xd800, OKIM6295_status_0_r },
  207.     { 0xe000, 0xe000, soundlatch_r },
  208.     { -1 }
  209. };
  210.  
  211. static struct MemoryWriteAddress writemem_sound[] = {
  212.     { 0x0000, 0xbfff, MWA_ROM },
  213.     { 0xc000, 0xc7ff, MWA_RAM },
  214.     { 0xc800, 0xc800, YM2151_register_port_0_w },
  215.     { 0xc801, 0xc801, YM2151_data_port_0_w },
  216.     { 0xd800, 0xd800, OKIM6295_data_0_w },
  217.     { 0xe800, 0xe800, oki_bankswitch_w },
  218.     { -1 }
  219. };
  220.  
  221. static struct MemoryReadAddress ctribe_readmem_sound[] = {
  222.     { 0x0000, 0x7fff, MRA_ROM },
  223.     { 0x8000, 0x87ff, MRA_RAM },
  224.     { 0x8801, 0x8801, YM2151_status_port_0_r },
  225.     { 0x9800, 0x9800, OKIM6295_status_0_r },
  226.     { 0xa000, 0xa000, soundlatch_r },
  227.     { -1 }
  228. };
  229.  
  230. static struct MemoryWriteAddress ctribe_writemem_sound[] = {
  231.     { 0x0000, 0x7fff, MWA_ROM },
  232.     { 0x8000, 0x87ff, MWA_RAM },
  233.     { 0x8800, 0x8800, YM2151_register_port_0_w },
  234.     { 0x8801, 0x8801, YM2151_data_port_0_w },
  235.     { 0x9800, 0x9800, OKIM6295_data_0_w },
  236.     { -1 }
  237. };
  238.  
  239. /***************************************************************************/
  240.  
  241. INPUT_PORTS_START( ddrago3b )
  242.     PORT_START
  243.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  244.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
  245.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  246.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  247.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  248.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  249.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
  250.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  251.  
  252.     PORT_START
  253.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_JOYSTICK_RIGHT | IPF_8WAY )
  254.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_JOYSTICK_LEFT | IPF_8WAY )
  255.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_JOYSTICK_UP | IPF_8WAY )
  256.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_JOYSTICK_DOWN | IPF_8WAY )
  257.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_BUTTON1 )
  258.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_BUTTON2 )
  259.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_BUTTON3 )
  260.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  261.  
  262.     PORT_START
  263.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_JOYSTICK_RIGHT | IPF_8WAY )
  264.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_JOYSTICK_LEFT | IPF_8WAY )
  265.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_JOYSTICK_UP | IPF_8WAY )
  266.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_JOYSTICK_DOWN | IPF_8WAY )
  267.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_BUTTON1 )
  268.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_BUTTON2 )
  269.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_BUTTON3 )
  270.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
  271.  
  272.     PORT_START
  273.     PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
  274.     PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
  275.     PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
  276.     PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )
  277.  
  278.     PORT_START /* DSW1 */
  279.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
  280.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  281.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  282.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  283.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  284.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) )
  285.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  286.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  287.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
  288.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  289.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  290.     PORT_DIPNAME( 0x10, 0x10, "Continue Discount" )
  291.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  292.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  293.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
  294.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  295.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  296.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
  297.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  298.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  299.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
  300.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  301.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  302.  
  303.     PORT_START /* DSW2 */
  304.     PORT_DIPNAME( 0x03, 0x03, DEF_STR(Difficulty) )
  305.     PORT_DIPSETTING(    0x02, "Easy" )
  306.     PORT_DIPSETTING(    0x03, "Normal" )
  307.     PORT_DIPSETTING(    0x01, "Hard" )
  308.     PORT_DIPSETTING(    0x00, "Hardest" )
  309.     PORT_DIPNAME( 0x04, 0x04, "P1 hurt P2" )
  310.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  311.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  312.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) /* timer speed? */
  313.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  314.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  315.     PORT_DIPNAME( 0x10, 0x10, "Test Mode" )
  316.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  317.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  318.     PORT_DIPNAME( 0x20, 0x20, "Stage Clear Power" )
  319.     PORT_DIPSETTING(    0x20, "0" )
  320.     PORT_DIPSETTING(    0x00, "50" )
  321.     PORT_DIPNAME( 0x40, 0x40, "Starting Power" )
  322.     PORT_DIPSETTING(    0x00, "200" )
  323.     PORT_DIPSETTING(    0x40, "230" )
  324.     PORT_DIPNAME( 0x80, 0x80, "Simultaneous Players" )
  325.     PORT_DIPSETTING(    0x80, "2" )
  326.     PORT_DIPSETTING(    0x00, "3" )
  327. INPUT_PORTS_END
  328.  
  329. INPUT_PORTS_START( ddragon3 )
  330.     PORT_START /* 180000 (P1 Controls) */
  331.     PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  332.     PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
  333.     PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  334.     PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  335.     PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )
  336.     PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )
  337.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 )
  338.     PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
  339.  
  340.     PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_JOYSTICK_RIGHT | IPF_8WAY )
  341.     PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_JOYSTICK_LEFT | IPF_8WAY )
  342.     PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_JOYSTICK_UP | IPF_8WAY )
  343.     PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_JOYSTICK_DOWN | IPF_8WAY )
  344.     PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_BUTTON1 )
  345.     PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_BUTTON2 )
  346.     PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_BUTTON3 )
  347.     PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
  348.  
  349.     PORT_START /* 180002 */
  350.     PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
  351.     PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
  352.     PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
  353.     PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 )
  354.     PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
  355.     PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
  356.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
  357.     PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
  358.  
  359.     PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
  360.  
  361.     PORT_START /* 180004 (P3 Controls) */
  362.     PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_JOYSTICK_RIGHT | IPF_8WAY )
  363.     PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_JOYSTICK_LEFT | IPF_8WAY )
  364.     PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_JOYSTICK_UP | IPF_8WAY )
  365.     PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_JOYSTICK_DOWN | IPF_8WAY )
  366.     PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_BUTTON1 )
  367.     PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_BUTTON2 )
  368.     PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_BUTTON3 )
  369.     PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START3 )
  370.  
  371.     /* DSWA */
  372.     PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Coinage ) )
  373.     PORT_DIPSETTING(      0x0000, "A" )
  374.     PORT_DIPSETTING(      0x0100, "B" )
  375.     PORT_DIPSETTING(      0x0200, "C" )
  376.     PORT_DIPSETTING(      0x0300, "D" )
  377.     PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
  378.     PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
  379.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  380.     PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
  381.     PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
  382.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  383.     PORT_DIPNAME( 0x1000, 0x1000, "Coin Statistics" )
  384.     PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
  385.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  386.     PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Demo_Sounds ) )
  387.     PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
  388.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  389.     PORT_DIPNAME( 0x4000, 0x4000, "Invert Screen" )
  390.     PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
  391.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  392.     PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
  393.     PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
  394.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  395.  
  396.     PORT_START /* 180006 DSW */
  397.     PORT_DIPNAME( 0x0100, 0x0100, "Starting Power" )
  398.     PORT_DIPSETTING(      0x0000, "200" )
  399.     PORT_DIPSETTING(      0x0100, "230" )
  400.     PORT_DIPNAME( 0x0200, 0x0200, "Simultaneous Players" )
  401.     PORT_DIPSETTING(      0x0200, "2" )
  402.     PORT_DIPSETTING(      0x0000, "3" )
  403.     PORT_DIPNAME( 0x0400, 0x0400, "Stage Clear Power" )
  404.     PORT_DIPSETTING(      0x0400, "50" )
  405.     PORT_DIPSETTING(      0x0000, "0" )
  406.     PORT_DIPNAME( 0x0800, 0x0800, "Test Mode?" )
  407.     PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
  408.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  409.     PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
  410.     PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
  411.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  412.     PORT_DIPNAME( 0x2000, 0x2000, "P1 hurt P2" )
  413.     PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
  414.     PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
  415.     PORT_DIPNAME( 0xc000, 0xc000, DEF_STR(Difficulty) )
  416.     PORT_DIPSETTING(      0x4000, "Easy" )
  417.     PORT_DIPSETTING(      0xc000, "Normal" )
  418.     PORT_DIPSETTING(      0x8000, "Hard" )
  419.     PORT_DIPSETTING(      0x0000, "Hardest" )
  420. INPUT_PORTS_END
  421.  
  422. INPUT_PORTS_START( ctribe )
  423.     PORT_START
  424.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  425.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
  426.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  427.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  428.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  429.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  430.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
  431.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  432.  
  433.     PORT_START
  434.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_JOYSTICK_RIGHT | IPF_8WAY )
  435.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_JOYSTICK_LEFT | IPF_8WAY )
  436.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_JOYSTICK_UP | IPF_8WAY )
  437.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_JOYSTICK_DOWN | IPF_8WAY )
  438.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_BUTTON1 )
  439.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_BUTTON2 )
  440.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPF_PLAYER2 | IPT_BUTTON3 )
  441.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  442.  
  443.     PORT_START
  444.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_JOYSTICK_RIGHT | IPF_8WAY )
  445.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_JOYSTICK_LEFT | IPF_8WAY )
  446.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_JOYSTICK_UP | IPF_8WAY )
  447.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_JOYSTICK_DOWN | IPF_8WAY )
  448.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_BUTTON1 )
  449.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_BUTTON2 )
  450.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPF_PLAYER3 | IPT_BUTTON3 )
  451.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
  452.  
  453.     PORT_START
  454.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  455.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  456.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  457.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )
  458.  
  459.     PORT_START /* DSW1 */
  460.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
  461.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  462.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  463.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  464.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  465.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) )
  466.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  467.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  468.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
  469.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  470.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  471.     PORT_DIPNAME( 0x10, 0x10, "Continue Discount" )
  472.     PORT_DIPSETTING(    0x10, DEF_STR( No ) )
  473.     PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
  474.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) )
  475.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  476.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  477.     PORT_DIPNAME( 0x40,    0x40, DEF_STR( Flip_Screen ) )
  478.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  479.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  480.     PORT_DIPNAME( 0x80,    0x80, DEF_STR( Unused ) )
  481.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  482.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  483.  
  484.     PORT_START /* DSW2 */
  485.     PORT_DIPNAME( 0x03, 0x03, DEF_STR(Difficulty) )
  486.     PORT_DIPSETTING(    0x02, "Easy" )
  487.     PORT_DIPSETTING(    0x03, "Normal" )
  488.     PORT_DIPSETTING(    0x01, "Hard" )
  489.     PORT_DIPSETTING(    0x00, "Hardest" )
  490.     PORT_DIPNAME( 0x04, 0x04, "Timer Speed" )
  491.     PORT_DIPSETTING(    0x04, "Normal" )
  492.     PORT_DIPSETTING(    0x00, "Fast" )
  493.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
  494.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  495.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  496.     PORT_DIPNAME( 0x10, 0x10, "Test Mode" )
  497.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  498.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  499.     PORT_DIPNAME( 0x60, 0x60, "Stage Clear Power" )
  500.     PORT_DIPSETTING(    0x60, "0" )
  501.     PORT_DIPSETTING(    0x40, "50" )
  502.     PORT_DIPSETTING(    0x20, "100" )
  503.     PORT_DIPSETTING(    0x00, "150" )
  504.     PORT_DIPNAME( 0x80, 0x80, "Simultaneous Players" )
  505.     PORT_DIPSETTING(    0x80, "2" )
  506.     PORT_DIPSETTING(    0x00, "3" )
  507. INPUT_PORTS_END
  508.  
  509. /***************************************************************************/
  510.  
  511. static struct GfxLayout tile_layout =
  512. {
  513.     16,16,    /* 16*16 tiles */
  514.     8192,    /* 8192 tiles */
  515.     4,    /* 4 bits per pixel */
  516.     { 0, 0x40000*8, 2*0x40000*8 , 3*0x40000*8 },    /* the bitplanes are separated */
  517.     { 0, 1, 2, 3, 4, 5, 6, 7,
  518.             16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7 },
  519.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  520.             8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  521.     32*8    /* every tile takes 32 consecutive bytes */
  522. };
  523.  
  524. static struct GfxLayout sprite_layout = {
  525.     16,16,    /* 16*16 tiles */
  526.     0x90000/32,    /* 4096 tiles */
  527.     4,    /* 4 bits per pixel */
  528.     { 0, 0x100000*8, 2*0x100000*8 , 3*0x100000*8 },    /* the bitplanes are separated */
  529.     { 0, 1, 2, 3, 4, 5, 6, 7,
  530.         16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7 },
  531.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  532.         8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  533.     32*8    /* every tile takes 32 consecutive bytes */
  534. };
  535.  
  536. static struct GfxDecodeInfo ddragon3_gfxdecodeinfo[] =
  537. {
  538.     { REGION_GFX1, 0, &tile_layout,      256, 32 },
  539.     { REGION_GFX2, 0, &sprite_layout,        0, 16 },
  540.     { -1 }
  541. };
  542.  
  543. /***************************************************************************/
  544.  
  545. static void dd3_ymirq_handler(int irq)
  546. {
  547.     cpu_set_irq_line( 1, 0 , irq ? ASSERT_LINE : CLEAR_LINE );
  548. }
  549.  
  550. static struct YM2151interface ym2151_interface =
  551. {
  552.     1,            /* 1 chip */
  553.     3579545,    /* Guess */
  554.     { YM3012_VOL(45,MIXER_PAN_LEFT,45,MIXER_PAN_RIGHT) },
  555.     { dd3_ymirq_handler }
  556. };
  557.  
  558. static struct OKIM6295interface okim6295_interface =
  559. {
  560.     1,              /* 1 chip */
  561.     { 8500 },       /* frequency (Hz) */
  562.     { REGION_SOUND1 },    /* memory region */
  563.     { 47 }
  564. };
  565.  
  566. /**************************************************************************/
  567.  
  568. static struct MachineDriver machine_driver_ddragon3 =
  569. {
  570.     {
  571.         {
  572.             CPU_M68000,
  573.             12000000, /* Guess */
  574.             readmem,writemem,0,0,
  575.             ddragon3_cpu_interrupt,2
  576.         },
  577.         {
  578.             CPU_Z80 | CPU_AUDIO_CPU,
  579.             3579545,    /* Guess */
  580.             readmem_sound,writemem_sound,0,0,
  581.             ignore_interrupt,0
  582.         },
  583.     },
  584.     60, DEFAULT_60HZ_VBLANK_DURATION,
  585.     1,    /* CPU slices per frame */
  586.     0, /* init machine */
  587.  
  588.     /* video hardware */
  589.     320, 240, { 0, 319, 8, 239 },
  590.  
  591.     ddragon3_gfxdecodeinfo,
  592.     768,768,
  593.     0,
  594.  
  595.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  596.     0,
  597.     ddragon3_vh_start,
  598.     0,
  599.     ddragon3_vh_screenrefresh,
  600.  
  601.     /* sound hardware */
  602.     SOUND_SUPPORTS_STEREO,0,0,0,
  603.     {
  604.         {
  605.             SOUND_YM2151,
  606.             &ym2151_interface
  607.         },
  608.         {
  609.             SOUND_OKIM6295,
  610.             &okim6295_interface
  611.         }
  612.     }
  613. };
  614.  
  615. static struct MachineDriver machine_driver_ddrago3b =
  616. {
  617.     {
  618.         {
  619.             CPU_M68000,
  620.             12000000, /* Guess */
  621.             dd3b_readmem,dd3b_writemem,0,0,
  622.             ddragon3_cpu_interrupt,2
  623.         },
  624.         {
  625.             CPU_Z80 | CPU_AUDIO_CPU,
  626.             3579545,    /* Guess */
  627.             readmem_sound,writemem_sound,0,0,
  628.             ignore_interrupt,0
  629.         },
  630.     },
  631.     60, DEFAULT_60HZ_VBLANK_DURATION,
  632.     1,    /* CPU slices per frame */
  633.     0, /* init machine */
  634.  
  635.     /* video hardware */
  636.     320, 240, { 0, 319, 8, 239 },
  637.  
  638.     ddragon3_gfxdecodeinfo,
  639.     768,768,
  640.     0,
  641.  
  642.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  643.     0,
  644.     ddragon3_vh_start,
  645.     0,
  646.     ddragon3_vh_screenrefresh,
  647.  
  648.     /* sound hardware */
  649.     SOUND_SUPPORTS_STEREO,0,0,0,
  650.     {
  651.         {
  652.             SOUND_YM2151,
  653.             &ym2151_interface
  654.         },
  655.         {
  656.             SOUND_OKIM6295,
  657.             &okim6295_interface
  658.         }
  659.     }
  660. };
  661.  
  662. static struct MachineDriver machine_driver_ctribe =
  663. {
  664.     {
  665.         {
  666.             CPU_M68000,
  667.             12000000, /* Guess */
  668.             ctribe_readmem,ctribe_writemem,0,0,
  669.             ddragon3_cpu_interrupt,2
  670.         },
  671.         {
  672.             CPU_Z80 | CPU_AUDIO_CPU,
  673.             3579545,    /* Guess */
  674.             ctribe_readmem_sound,ctribe_writemem_sound,0,0,
  675.             ignore_interrupt,0
  676.         },
  677.     },
  678.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  679.     1,    /* CPU slices per frame */
  680.     0, /* init machine */
  681.  
  682.     /* video hardware */
  683.     320, 240, { 0, 319, 8, 239 },
  684.  
  685.     ddragon3_gfxdecodeinfo,
  686.     768,768,
  687.     0,
  688.  
  689.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  690.     0,
  691.     ddragon3_vh_start,
  692.     0,
  693.     ctribe_vh_screenrefresh,
  694.  
  695.     /* sound hardware */
  696.     SOUND_SUPPORTS_STEREO,0,0,0,
  697.     {
  698.         {
  699.             SOUND_YM2151,
  700.             &ym2151_interface
  701.         },
  702.         {
  703.             SOUND_OKIM6295,
  704.             &okim6295_interface
  705.         }
  706.     }
  707. };
  708.  
  709. /**************************************************************************/
  710.  
  711. ROM_START( ddragon3 )
  712.     ROM_REGION( 0x80000, REGION_CPU1 )    /* 64k for cpu code */
  713.     ROM_LOAD_ODD ( "30a14" ,  0x00000, 0x40000, 0xf42fe016 )
  714.     ROM_LOAD_EVEN( "30a15" ,  0x00000, 0x20000, 0xad50e92c )
  715.  
  716.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound cpu code */
  717.     ROM_LOAD( "dd3.06" ,   0x00000, 0x10000, 0x1e974d9b )
  718.  
  719.     ROM_REGION( 0x200000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  720.     ROM_LOAD( "dd3.f" ,  0x000000, 0x40000, 0x89d58d32 ) /* Background */
  721.     ROM_LOAD( "dd3.e" ,  0x040000, 0x40000, 0x9bf1538e )
  722.     ROM_LOAD( "dd3.b" ,  0x080000, 0x40000, 0x8f671a62 )
  723.     ROM_LOAD( "dd3.a" ,  0x0c0000, 0x40000, 0x0f74ea1c )
  724.  
  725.     ROM_REGION( 0x400000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  726.     /* sprites  */
  727.     ROM_LOAD( "dd3.3e" ,  0x000000, 0x20000, 0x726c49b7 ) //4a
  728.     ROM_LOAD( "dd3.3d" ,  0x020000, 0x20000, 0x37a1c335 ) //3a
  729.     ROM_LOAD( "dd3.3c" ,  0x040000, 0x20000, 0x2bcfe63c ) //2a
  730.     ROM_LOAD( "dd3.3b" ,  0x060000, 0x20000, 0xb864cf17 ) //1a
  731.     ROM_LOAD( "dd3.3a" ,  0x080000, 0x10000, 0x20d64bea ) //5a
  732.  
  733.     ROM_LOAD( "dd3.2e" ,  0x100000, 0x20000, 0x8c71eb06 ) //4b
  734.     ROM_LOAD( "dd3.2d" ,  0x120000, 0x20000, 0x3e134be9 ) //3b
  735.     ROM_LOAD( "dd3.2c" ,  0x140000, 0x20000, 0xb4115ef0 ) //2b
  736.     ROM_LOAD( "dd3.2b" ,  0x160000, 0x20000, 0x4639333d ) //1b
  737.     ROM_LOAD( "dd3.2a" ,  0x180000, 0x10000, 0x785d71b0 ) //5b
  738.  
  739.     ROM_LOAD( "dd3.1e" ,  0x200000, 0x20000, 0x04420cc8 ) //4c
  740.     ROM_LOAD( "dd3.1d" ,  0x220000, 0x20000, 0x33f97b2f ) //3c
  741.     ROM_LOAD( "dd3.1c" ,  0x240000, 0x20000, 0x0f9a8f2a ) //2c
  742.     ROM_LOAD( "dd3.1b" ,  0x260000, 0x20000, 0x15c91772 ) //1c
  743.     ROM_LOAD( "dd3.1a" ,  0x280000, 0x10000, 0x15e43d12 ) //5c
  744.  
  745.     ROM_LOAD( "dd3.0e" ,  0x300000, 0x20000, 0x894734b3 ) //4d
  746.     ROM_LOAD( "dd3.0d" ,  0x320000, 0x20000, 0xcd504584 ) //3d
  747.     ROM_LOAD( "dd3.0c" ,  0x340000, 0x20000, 0x38e8a9ad ) //2d
  748.     ROM_LOAD( "dd3.0b" ,  0x360000, 0x20000, 0x80c1cb74 ) //1d
  749.     ROM_LOAD( "dd3.0a" ,  0x380000, 0x10000, 0x5a47e7a4 ) //5d
  750.  
  751.     ROM_REGION( 0x080000, REGION_SOUND1 )    /* ADPCM Samples */
  752.     ROM_LOAD( "dd3.j7" ,  0x000000, 0x40000, 0x3af21dbe )
  753.     ROM_LOAD( "dd3.j8" ,  0x040000, 0x40000, 0xc28b53cd )
  754. ROM_END
  755.  
  756. ROM_START( ddrago3b )
  757.     ROM_REGION( 0x80000, REGION_CPU1 )    /* 64k for cpu code */
  758.     ROM_LOAD_ODD ( "dd3.01" ,  0x00000, 0x20000, 0x68321d8b )
  759.     ROM_LOAD_EVEN( "dd3.03" ,  0x00000, 0x20000, 0xbc05763b )
  760.     ROM_LOAD_ODD ( "dd3.02" ,  0x40000, 0x20000, 0x38d9ae75 )
  761.     /* No EVEN rom! */
  762.  
  763.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound cpu code */
  764.     ROM_LOAD( "dd3.06" ,   0x00000, 0x10000, 0x1e974d9b )
  765.  
  766.     ROM_REGION( 0x200000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  767.     /* Background */
  768.     ROM_LOAD( "dd3.f" ,  0x000000, 0x40000, 0x89d58d32 )
  769.     ROM_LOAD( "dd3.e" ,  0x040000, 0x40000, 0x9bf1538e )
  770.     ROM_LOAD( "dd3.b" ,  0x080000, 0x40000, 0x8f671a62 )
  771.     ROM_LOAD( "dd3.a" ,  0x0c0000, 0x40000, 0x0f74ea1c )
  772.  
  773.     ROM_REGION( 0x400000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  774.     /* sprites  */
  775.     ROM_LOAD( "dd3.3e" ,  0x000000, 0x20000, 0x726c49b7 ) //4a
  776.     ROM_LOAD( "dd3.3d" ,  0x020000, 0x20000, 0x37a1c335 ) //3a
  777.     ROM_LOAD( "dd3.3c" ,  0x040000, 0x20000, 0x2bcfe63c ) //2a
  778.     ROM_LOAD( "dd3.3b" ,  0x060000, 0x20000, 0xb864cf17 ) //1a
  779.     ROM_LOAD( "dd3.3a" ,  0x080000, 0x10000, 0x20d64bea ) //5a
  780.  
  781.     ROM_LOAD( "dd3.2e" ,  0x100000, 0x20000, 0x8c71eb06 ) //4b
  782.     ROM_LOAD( "dd3.2d" ,  0x120000, 0x20000, 0x3e134be9 ) //3b
  783.     ROM_LOAD( "dd3.2c" ,  0x140000, 0x20000, 0xb4115ef0 ) //2b
  784.     ROM_LOAD( "dd3.2b" ,  0x160000, 0x20000, 0x4639333d ) //1b
  785.     ROM_LOAD( "dd3.2a" ,  0x180000, 0x10000, 0x785d71b0 ) //5b
  786.  
  787.     ROM_LOAD( "dd3.1e" ,  0x200000, 0x20000, 0x04420cc8 ) //4c
  788.     ROM_LOAD( "dd3.1d" ,  0x220000, 0x20000, 0x33f97b2f ) //3c
  789.     ROM_LOAD( "dd3.1c" ,  0x240000, 0x20000, 0x0f9a8f2a ) //2c
  790.     ROM_LOAD( "dd3.1b" ,  0x260000, 0x20000, 0x15c91772 ) //1c
  791.     ROM_LOAD( "dd3.1a" ,  0x280000, 0x10000, 0x15e43d12 ) //5c
  792.  
  793.     ROM_LOAD( "dd3.0e" ,  0x300000, 0x20000, 0x894734b3 ) //4d
  794.     ROM_LOAD( "dd3.0d" ,  0x320000, 0x20000, 0xcd504584 ) //3d
  795.     ROM_LOAD( "dd3.0c" ,  0x340000, 0x20000, 0x38e8a9ad ) //2d
  796.     ROM_LOAD( "dd3.0b" ,  0x360000, 0x20000, 0x80c1cb74 ) //1d
  797.     ROM_LOAD( "dd3.0a" ,  0x380000, 0x10000, 0x5a47e7a4 ) //5d
  798.  
  799.     ROM_REGION( 0x080000, REGION_SOUND1 )    /* ADPCM Samples */
  800.     ROM_LOAD( "dd3.j7" ,  0x000000, 0x40000, 0x3af21dbe )
  801.     ROM_LOAD( "dd3.j8" ,  0x040000, 0x40000, 0xc28b53cd )
  802. ROM_END
  803.  
  804. ROM_START( ctribe )
  805.     ROM_REGION( 0x80000, REGION_CPU1 )    /* 64k for cpu code */
  806.     ROM_LOAD_ODD ( "ic-26",      0x00000, 0x20000, 0xc46b2e63 )
  807.     ROM_LOAD_EVEN( "ic-25",      0x00000, 0x20000, 0x3221c755 )
  808.     ROM_LOAD_ODD ( "ct_ep2.rom", 0x40000, 0x10000, 0x8c2c6dbd )
  809.     /* No EVEN rom! */
  810.  
  811.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound cpu code */
  812.     ROM_LOAD( "ct_ep4.rom",   0x00000, 0x8000, 0x4346de13 )
  813.  
  814.     ROM_REGION( 0x200000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  815.     ROM_LOAD( "ct_mr7.rom",  0x000000, 0x40000, 0xa8b773f1 )     /* Background */
  816.     ROM_LOAD( "ct_mr6.rom",  0x040000, 0x40000, 0x617530fc )
  817.     ROM_LOAD( "ct_mr5.rom",  0x080000, 0x40000, 0xcef0a821 )
  818.     ROM_LOAD( "ct_mr4.rom",  0x0c0000, 0x40000, 0xb84fda09 )
  819.  
  820.     ROM_REGION( 0x400000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  821.     ROM_LOAD( "ct_mr3.rom",  0x000000, 0x80000, 0x1ac2a461 )     /* Sprites */
  822.     ROM_LOAD( "ct_ep5.rom",  0x080000, 0x10000, 0x972faddb )
  823.     ROM_LOAD( "ct_mr2.rom",  0x100000, 0x80000, 0x8c796707 )
  824.     ROM_LOAD( "ct_ep6.rom",  0x180000, 0x10000, 0xeb3ab374 )
  825.     ROM_LOAD( "ct_mr1.rom",  0x200000, 0x80000, 0x1c9badbd )
  826.     ROM_LOAD( "ct_ep7.rom",  0x280000, 0x10000, 0xc602ac97 )
  827.     ROM_LOAD( "ct_mr0.rom",  0x300000, 0x80000, 0xba73c49e )
  828.     ROM_LOAD( "ct_ep8.rom",  0x380000, 0x10000, 0x4da1d8e5 )
  829.  
  830.     ROM_REGION( 0x040000, REGION_SOUND1 )    /* ADPCM Samples */
  831.     ROM_LOAD( "ct_mr8.rom" ,  0x020000, 0x20000, 0x9963a6be )
  832.     ROM_CONTINUE(             0x000000, 0x20000 )
  833. ROM_END
  834.  
  835. ROM_START( ctribeb )
  836.     ROM_REGION( 0x80000, REGION_CPU1 )    /* 64k for cpu code */
  837.     ROM_LOAD_ODD ( "ct_ep1.rom", 0x00000, 0x20000, 0x9cfa997f )
  838.     ROM_LOAD_EVEN( "ct_ep3.rom", 0x00000, 0x20000, 0x2ece8681 )
  839.     ROM_LOAD_ODD ( "ct_ep2.rom", 0x40000, 0x10000, 0x8c2c6dbd )
  840.     /* No EVEN rom! */
  841.  
  842.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound cpu code */
  843.     ROM_LOAD( "ct_ep4.rom",   0x00000, 0x8000, 0x4346de13 )
  844.  
  845.     ROM_REGION( 0x200000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  846.     ROM_LOAD( "ct_mr7.rom",  0x000000, 0x40000, 0xa8b773f1 )     /* Background */
  847.     ROM_LOAD( "ct_mr6.rom",  0x040000, 0x40000, 0x617530fc )
  848.     ROM_LOAD( "ct_mr5.rom",  0x080000, 0x40000, 0xcef0a821 )
  849.     ROM_LOAD( "ct_mr4.rom",  0x0c0000, 0x40000, 0xb84fda09 )
  850.  
  851.     ROM_REGION( 0x400000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  852.     ROM_LOAD( "ct_mr3.rom",  0x000000, 0x80000, 0x1ac2a461 )     /* Sprites */
  853.     ROM_LOAD( "ct_ep5.rom",  0x080000, 0x10000, 0x972faddb )
  854.     ROM_LOAD( "ct_mr2.rom",  0x100000, 0x80000, 0x8c796707 )
  855.     ROM_LOAD( "ct_ep6.rom",  0x180000, 0x10000, 0xeb3ab374 )
  856.     ROM_LOAD( "ct_mr1.rom",  0x200000, 0x80000, 0x1c9badbd )
  857.     ROM_LOAD( "ct_ep7.rom",  0x280000, 0x10000, 0xc602ac97 )
  858.     ROM_LOAD( "ct_mr0.rom",  0x300000, 0x80000, 0xba73c49e )
  859.     ROM_LOAD( "ct_ep8.rom",  0x380000, 0x10000, 0x4da1d8e5 )
  860.  
  861.     ROM_REGION( 0x040000, REGION_SOUND1 )    /* ADPCM Samples */
  862.     ROM_LOAD( "ct_mr8.rom" ,  0x020000, 0x20000, 0x9963a6be )
  863.     ROM_CONTINUE(             0x000000, 0x20000 )
  864. ROM_END
  865.  
  866. /**************************************************************************/
  867.  
  868. GAMEX( 1990, ddragon3, 0,        ddragon3, ddragon3, 0, ROT0, "Technos", "Double Dragon 3 - The Rosetta Stone", GAME_NO_COCKTAIL )
  869. GAMEX( 1990, ddrago3b, ddragon3, ddrago3b, ddrago3b, 0, ROT0, "bootleg", "Double Dragon 3 - The Rosetta Stone (bootleg)", GAME_NO_COCKTAIL )
  870. GAMEX( 1990, ctribe,   0,        ctribe,   ctribe,   0, ROT0, "Technos", "The Combatribes (US)", GAME_NO_COCKTAIL )
  871. GAMEX( 1990, ctribeb,  ctribe,   ctribe,   ctribe,   0, ROT0, "bootleg", "The Combatribes (bootleg)", GAME_NO_COCKTAIL )
  872.